﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DAL
{
    public static class SiteProvider
    {
        static private ArticlesProvider _articleInstance = null;
        static public ArticlesProvider Articles
        {
            get
            {
                if (_articleInstance == null)
                    _articleInstance =(ArticlesProvider)Activator.CreateInstance(Type.GetType("DAL.ArticlesProvider"));
                return _articleInstance;
            }
        }

        static private StoreProvider _storeInstance = null;
        static public StoreProvider Store
        {
            get
            {
                if (_storeInstance == null)
                    _storeInstance = (StoreProvider)Activator.CreateInstance(Type.GetType("DAL.StoreProvider"));
                return _storeInstance;
            }
        }


        static private BranchProvider _branchInstance = null;
        static public BranchProvider BranchAnLoan
        {
            get 
            {
                if (_branchInstance == null)
                    _branchInstance = (BranchProvider)Activator.CreateInstance(Type.GetType("DAL.BranchProvider"));
                return _branchInstance;
            }
        }

        static private PageProvider _pageInstance = null;
        static public PageProvider Pages
        {
            get
            {
                if (_pageInstance == null)
                    _pageInstance = (PageProvider)Activator.CreateInstance(Type.GetType("DAL.PageProvider"));
                return _pageInstance;
            }
        }

        static private SettingProvider _settingInstance = null;
        static public SettingProvider Setting
        {
            get
            {
                if (_settingInstance == null)
                    _settingInstance = (SettingProvider)Activator.CreateInstance(Type.GetType("DAL.SettingProvider"));
                return _settingInstance;
            }
        }

        static private MediaProvider _mediaInstance = null;
        static public MediaProvider Media
        {
            get
            {
                if (_mediaInstance == null)
                    _mediaInstance = (MediaProvider)Activator.CreateInstance(Type.GetType("DAL.MediaProvider"));
                return _mediaInstance;
            }
        }

        static private FaqProvider _contactInstance = null;
        static public FaqProvider Faq
        {
            get
            {
                if (_contactInstance == null)
                    _contactInstance = (FaqProvider)Activator.CreateInstance(Type.GetType("DAL.FaqProvider"));
                return _contactInstance;
            }
        }
    }
}
